<?php

include_once '../../Core/Conexion.php';
include_once '../../Core/ControladorSet.php';
include_once '../../Core/InterfazDatos.php';
///****
include_once '../entidades/Periodo.php';

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of lista
 *
 * @author cHr15t14n
 */
class lista extends ControladorSet {

    public function buscarValores() {
        $tabla = "";
        $entidad = new Periodo("", "", "", "", "","");
        $consulta = $this->conexion->consultaTabla($entidad);
        $fila = mysql_fetch_array($consulta);
        do {
            $tabla = $tabla . "<tr>";
            $tabla = $tabla . "<td>" . $fila[1] . "</td>";
            $tabla = $tabla . "<td>" . $fila[2] . "</td>";
            $tabla = $tabla . "<td>" . $fila[3] . "</td>";
            $tabla = $tabla . "<td>" . $fila[4] . "</td>";
            $tabla = $tabla . "<td>" . $fila[5] . "</td>";

            $tabla = $tabla . "<td>" . "<a href=editar.php?codigo=" . $fila[0] . " >edit<a>" . "</td>";
            $tabla = $tabla . "<td>" . "<a onclick='return confirm(\"Seguro que desea eliminar estos datos?\");' href=php/Eliminar.php?codigo=" . $fila[0] . " >elimr<a>" . "</td>";
            $tabla = $tabla . "</tr>";
        } while ($fila = mysql_fetch_array($consulta));
        $this->diccionario['tabla'] = $tabla;
    }

    public function setDiccionario() {
        $this->diccionario = array(
            "tabla" => "vacio",
        );
    }
    
    public function setValorSesion() {
        $this->valorSesion = array("admin", "", "");
    }

//put your code here
}

$controlador = new lista('listaVista.php');
$controlador->rederizarPagina();
